﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Maticsoft.DBUtility;
using System.Net;
using System.Configuration;
namespace SmsSend
{
   public  class Init_GlobalSetting
    {
        public static string wwwAddress = "";
        public static string NewReg = "";
        public static string GetPwd = "";

        //public static string wwwAddress = ConfigurationManager.AppSettings["wwwAddress"];
        //public static string NewReg = ConfigurationManager.AppSettings["NewReg"];
        //public static string GetPwd = ConfigurationManager.AppSettings["GetPwd"]; 

        private static string _yonghuming;
        private static string _quanxian;
        private static string _duanxindanjia1;
        private static string _duanxindanjia2;
        private static string _yu_e;
        private static string _sskID;
        private static int _OID;
        private static CookieCollection _CookCollection;
        private static CookieContainer _CookContainer;

        /// <summary>
        /// 给各个webbrower传递的CookieCollection
        /// </summary>
        public static CookieCollection CookCollection
        {
            set { _CookCollection = value; }
            get { return _CookCollection; }
        }

        /// <summary>
        /// 给各个webbrower传递的CookieContainer
        /// </summary>
        public static CookieContainer CookContainer
        {
            set { _CookContainer = value; }
            get { return _CookContainer; }
        }

        /// <summary>
        /// 全局用户名
        /// </summary>
        public static string yonghuming
        {
            set { _yonghuming = value; }
            get { return _yonghuming; }
        }


        /// <summary>
        /// 全局权限
        /// </summary>
        public static string quanxian
        {
            set { _quanxian = value; }
            get { return _quanxian; }
        }


        /// <summary>
        /// 全局短信单价1
        /// </summary>
        public static string danxindanjia1
        {
            set { _duanxindanjia1 = value; }
            get { return _duanxindanjia1; }
        }


        /// <summary>
        /// 全局短信单价2
        /// </summary>
        public static string danxindanjia2
        {
            set { _duanxindanjia2 = value; }
            get { return _duanxindanjia2; }
        }

        /// <summary>
        /// 全局短信单价2
        /// </summary>
        public static string yu_e
        {
            set { _yu_e = value; }
            get { return _yu_e; }
        }


        
        /// <summary>
        /// ssk皮肤的文件序号
        /// </summary>
        public static string sskID
        {
            set { _sskID = value; }
            get { return _sskID; }
        } 

        /// <summary>
        /// 所属公司ID
        /// </summary>
        public static int OID
        {
            set { _OID = value; }
            get { return _OID; }
        }









        private static string _LoginUserID;
        private static  string _LoginUserName;
        private static string _OIDName;
        private static decimal _MostLowerSaveValue;
        private static double _MoneyToScorePara;
        private static string _TradeCode;
        private static string _TradeName;


        

 


        

       /// <summary>
       /// 操作员ID
       /// </summary>
        public static  string  LoginUserID
        {
            set { _LoginUserID = value; }
            get { return _LoginUserID; }
        }
        /// <summary>
        /// 操作员名称
        /// </summary>
        public static string LoginUserName
        {
            set { _LoginUserName = value; }
            get { return _LoginUserName; }
        }
        /// <summary>
        /// 分店名称
        /// </summary>
        public static string OIDName
        {
            set { _OIDName = value; }
            get { return _OIDName; }
        }
        /// <summary>
        /// 最低储值金额
        /// </summary>
        public static decimal  MostLowerSaveValue
        {
            set { _MostLowerSaveValue = value; }
            get { return _MostLowerSaveValue; }
        }
        /// <summary>
        /// 金额换积分系数
        /// </summary>
        public static double MoneyToScorePara
        {
            set { _MoneyToScorePara = value; }
            get { return _MoneyToScorePara; }
        }

       /// <summary>
       /// 行业代码
       /// </summary>
        public static string TradeCode
        {
            set { _TradeCode = value; }
            get { return _TradeCode; }
        }
       /// <summary>
       /// 行业名称
       /// </summary>
        public static string TradeName
        {
            set { _TradeName = value; }
            get { return _TradeName; }
        }

       /// <summary>
       /// 获取登录用户信息
       /// </summary>
        public static void GetSettingValue()
        {
            string strsql = "select * from CEM_V_T_SysLoginAccount where UserID='" + LoginUserID + "'";
            DataTable dt = DbHelperSQL.GetDatatable(strsql.ToString());
            if (dt.Rows.Count > 0)
            {
                LoginUserName = dt.Rows[0]["EmployeeName"].ToString();
                OID = int.Parse(dt.Rows[0]["OId"].ToString());
                OIDName =dt.Rows[0]["CompanyName"].ToString();
            }
        }
       /// <summary>
        /// 2011-09-24 获取最低储值金额
       /// </summary>
       /// <param name="strWhere"></param>
        public static void GetSysSetting(string strWhere)
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendLine("select * from CRM_T_Dict_SysSetting");
            if (strWhere != "")
            {
                sql.AppendLine(" where " +strWhere);
            }
            DataTable dt = DbHelperSQL.GetDatatable(sql.ToString());
            if (dt.Rows.Count > 0)
            {
                MostLowerSaveValue = decimal.Parse(dt.Rows[0]["ParaValue"].ToString());
            }
        }

       /// <summary>
       ///add by zhongxy 2011-09-27 获取当前行业
       /// </summary>
        public static void GetTradeSet()
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendLine("select * from CRM_T_Dict_TradeSet");
            sql.AppendLine(" where IsSele=0 " );
            DataTable dt = DbHelperSQL.GetDatatable(sql.ToString());
            if (dt.Rows.Count > 0)
            {
                TradeCode = dt.Rows[0]["TradeCode"].ToString();
                TradeName = dt.Rows[0]["TradeName"].ToString();
            }
        }
    }
}
